package jp.tkym.labs.store.api;

import java.util.ArrayList;
import java.util.List;

import jp.tkym.labs.store.api.Entity;
import jp.tkym.labs.store.api.Indexed;
import jp.tkym.labs.store.api.Key;

@Entity
public class Person {
	private long id;
	private String name;
	private String address;
	private int age;
	private boolean administrator;
	private List<PersonByoumei> byoumeiList = new ArrayList<PersonByoumei>();
	@Key
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Indexed
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	@Indexed
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public void addPersonByoumei(PersonByoumei byoumei){
		this.byoumeiList.add(byoumei);
	}
	public void removePersonByoumei(PersonByoumei byoumei){
		this.byoumeiList.remove(byoumei);
	}
	public PersonByoumei getPersonByoumei(int index){
		return this.byoumeiList.get(index);
	}
	@Indexed
	public boolean isAdministrator(){
		return administrator;
	}
	public void setAdministrator(boolean administrator){
		this.administrator = administrator;
	}
}